The preferred embodiment concerns a method for implementation of the data transfer between program elements of a process as well as a buffer object for implementation of the data transfer between program elements of a process and a printing system that is designed to execute the method of the preferred embodiment.
The programming and synchronization of threads is explained in “Win 32 Multithreaded Programming”, Aaron Cohen and Mike Woodring, O'Reilly & Associates Inc., ISBN 1-56592-296-4, in particular on the pages 258 through 269 and 301 through 303. Such threads are subsequently designated as program segments.
A computer comprises a central processing unit (CPU) and data memory. The fundamental functions of a computer are controlled by an operating system. The operating system subdivides the memory into a plurality of logical memory regions.
One or more computer programs can be executed on the computer. A computer program normally comprises a single process. A separate virtual memory range is associated with each process for communication within this process. A process can comprise one or more program segments or threads.
A program segment in turn comprises one or more objects. The individual objects comprise one or more methods, corresponding fields, and variables.
The term “class” was coined in object-oriented programming and, in the sense of the present patent application, means a closed unit that comprises data as well as methods stored in fields and variables. The classes are converted into objects, whereby the respective objects represent the runtime program of the class. A specific object can be a component of different program segments, meaning that the methods contained therein can be called by the different program segments. The same objects of different program segments differ only in the data stored in the fields and variables. They possess the same program structure.
It is known to link a plurality of processes into a process chain, whereby special communication programs are used for this that control the communication between the individual processes. These communication programs can be designed for data transfer within a computer or even within a network. Given such process chains the data are normally cached by the communication programs between the individual processes, normally on a mass storage such as, for example, a hard drive.
A method for synchronization of program segments of a computer program arises from WO 01/40931 A2. This method is provided for synchronization of program segments that can run on different processors.
This method for synchronization of program segments provides a buffer in which the reading and writing is controlled by means of a standard function (such as, for example, a semaphore) as well as by means of one or more buffer segment flags. For this the buffer is controlled with the standard function and with the buffer flag by buffer methods.
This control occurs such that during the access of a first buffer method to the buffer a simultaneous access to the buffer for a second method is prevented. The access by read program segments and generator program segments to buffer segments is controlled with the buffer segment flags that are set by the buffer method. Specific buffer segments are released with the access of the buffer methods. After an occurred release it is possible that data are simultaneously read or written into different buffer segments.
This method is very advantageous for program segments running on different processors since the data transfer between the individual program segments is designed to be very efficient and versatile and the data are transferred asynchronously between individual program segments. This method is thus designed very simply.
As is stated above, a program segment can comprise a plurality of objects. Here it is also known to execute the communication between individual data-processing objects (which are designated in the following as DV objects) by means of buffers. Differentiation is made between DV objects that generate data for another DV object (and which are designated in the following as write objects) and DV objects that process such data and are designated in the following as read objects. The write objects write data into a buffer and the read objects read out again the data written into the buffer.
FIG. 1 schematically shows three DV objects O1, O2, O3 and two buffers PU1 and PU2 respectively arranged between the DV objects O1, O2, O3. The buffers PU1 and PU2 in turn represent objects. The data transfer between the DV objects and the buffers is represented with the arrows DT. The DV object O1 is a write object for the buffer PU1 since it writes data into this buffer. The DV object O2 is a read object with regard to the buffer PU1 since it reads data from this buffer PU1. The data read out by the DV object O2 are processed by it and subsequently written into the buffer PU2. The DV object O2 is a write object with regard to the buffer PU2. The data written into the buffer PU2 are read out again by the DV object O3.
The control of the data transfer occurs via calling of a method of one DV object by another DV object.
The DV object O1 thus calls a control method (S1) in the DV object O2 when the input buffer PU2 is fully written with data. The object O2 hereupon reads out the data stored in the buffer PU1. The object O2 calls a corresponding control method (S2) in the object O3, whereupon this reads out the data from the buffer PU2. If the DV object O3 has completely read out all data, the control method (S2) (and herewith also the control method (S1)) is also ended, whereby the program workflow is reset to the DV object O1. The DV object O1 can then write further data into the buffer PU1 again. The control methods can also be designed somewhat differently. In principle, however, known controls of the data transfer between DV objects operate via calling of a control method of one DV object by another DV object.
Given this control of the data transfer an object that calls a method of a further object must be known to the further object, meaning that the corresponding properties of the further object or its function are to be taken into account in the programming of such an object or its class.
Since the calling of a method of a further object can depend on different conditions (for example a buffer is full or no further data are present for writing into the buffer), the control of the data transfer across a plurality of objects can be very complex.
The communication between the objects within a process must be unambiguously defined once via the transmission of the control signals directly from one object to a further object. The structure of the data transfer can only be altered when the objects affected by this are also correspondingly changed, in particular when their interaction with the control methods is altered. In practice individual objects are therefore normally programmed as a unit and then no longer altered.
A method for implementation of a data transfer between program elements arises from “Turning streams inside out, Part 2: Optimizing internal Java I/O”, Internet publication, 3 Sep. 2002, pages 1 through 17, XP002348074. In this a ring buffer is used in which two program elements can access in the form of threads. For synchronization updated values are generated that reflect the state of the buffer. When a program element wants to read data from the buffer, it queries whether data are available. When data are available, these are read. Otherwise this program element passes into a wait state.